<!doctype html>
<html>
<head>
    <title>微名片</title>
    <?php $this->load->module('admin/index/page_header');?>
    <link href="<?php echo URLPRE;?>static/admin/css/font_icon.css" rel="stylesheet" />
</head>
<body>
<div class="wrap">
<!--    <div class="h_a">说明</div>-->
<!--    <div class="prompt_text">-->
<!--        <ul>-->
<!--            <li>自定义菜单最多包括3个一级菜单，每个一级菜单最多包含5个二级菜单。一级菜单最多4个汉字，二级菜单最多7个汉字，多出来的部分将会以“...”代替。</li>-->
<!--            <li><font color="#FF0000">请注意，创建自定义菜单后，由于微信客户端缓存，需要24小时微信客户端才会展现出来。建议测试时可以尝试取消关注公众账号后再次关注，则可以看到创建后的效果。</font></li>-->
<!--        </ul>-->
<!--    </div>-->
    <div class="nav">
        <ul>
            <li class="current"><a href="javascript:;">微名片管理</a></li>
            <?php if($this->session->userdata('_ACCESS_LIST')=='ALL'){ ?>
            <?php if(CS){ ?><li><a href="<?php echo site_url('admin/adminuser/add?type=wmp');?>">添加微名片</a></li><?php }?>
            <?php } ?>
            <li><a href="<?php echo site_url('weixin/admin/cardsetting');?>">微名片模板</a></li>
        </ul>
    </div>
    <div class="table_list">
        <div class="h_a">高级搜索</div>
        <table width="100%">
            <tbody>
            <tr>
                <td>
                    <form action="" method="post">
                        <input type="text" value="<?php echo $condition_str?>" placeholder="用户名/姓名/手机号/..." name="keywords" class="input rounded" size="20" />
                        <input type="submit" class="btn" value="搜索">
                    </form>
                </td>
            </tr>
            </tbody>
        </table>

        <form action="" method="post" class="formvalidate">
            <table width="100%">
                <thead>
                <tr>
                    <td>操作</td>
                    <?php if(in_array(SITEID, array( 751))){ echo '<td>二级微名片</td>';}?>
                    <td width="120">对应管理账号</td>
                    <td width="100">姓名</td>
                    <td width="70">头像</td>
<!--                    <td width="150">昵称</td>-->
                    <td>手机</td>
<!--                    <td width="100">微信状态</td>-->
                    <td width="320">微信号</td>
                    <td width="100">浏览 / 分享次数</td>
                </tr>
                </thead>
                <tbody>
                    <?php
                    foreach ($expert as $v) {
                    ?>
                        <tr>
                            <td class='btn_min'>
                                <div class='operat hidden'>
                                    <a class='icon-cog action' href='javascript:;'>处理</a>
                                    <div class='menu_select'>
                                        <ul>
                                            <li><a class='icon-pencil' href='<?php echo site_url('expert/admin/edit_expert/'.$v['id']);?>'>编辑</a></li>
                                            <?php if($this->session->userdata('_ACCESS_LIST') == 'ALL'){?>
                                                <?php if(isset($cards[$v['id']])):?>
                                                    <li><a class='icon-remove-2 doUnbind' data-uri='<?php echo site_url('weixin/admin/unbind_card/?id='.$v['id']);?>'>解除绑定</a></li>
                                                <?php endif;?>
                                            <?php }?>
                                        </ul>
                                    </div>
                                </div>
                            </td>
                            <?php if(in_array(SITEID, array( 751))){?>
                                <td>
                                    <?php echo rtrim($v['sub_string'], ',')?>
                                </td>
                            <?php }?>
                            <td><?php echo $v['name']?></td>
                            <td><?php echo $v['realname'] ? $v['realname'] : '-'?></td>
                            <td><img width="60" src="<?php echo URLPIC.$v['avatar']?>" onerror="this.error=null;this.src='<?php echo site_url('static/public/images/nophoto.jpg')?>'"></td>
<!--                            <td>--><?php //echo $v['nickname']?><!--</td>-->
                            <td><?php echo $v['mobile']?></td>
                            <td>
                                <?php echo isset($cards[$v['id']]) ? '<b style="color:#5AB723;font-style:normal">已绑定</b>' : '<b style="font-style:normal;color:#ff5635">未绑定</b>';?>
                                <?php if(isset($cards[$v['id']])):?>
                                <span class="weixinhead" data-id="<?php echo $cards[$v['id']]['openid'];?>"></span>
                                <?php endif;?>
                            </td>
                            <td>
                                <?php echo "<span style='color:#5AB723;font-weight:bold'>$v[views]</span>", '/<a href="'.site_url('weixin/admin/sharelog/'.$v['id']).'"><span style="color:#ff5635;font-weight:bold">' .$v['share'].'</span></a>'?>
                                <a href="<?php echo site_url('mobile/member/card/?eid='.$v['id']).'&preview=1' ?>" target="_blank">预览</a>
                                <a href="<?php echo $v['qr_img']?>" target="_blank"><img src="<?php echo $v['qr_img']?>" style="height:40px;" >  </a>
                            </td>
                        </tr>
                    <?php }?>
                </tbody>
            </table>
        </form>
    </div>
    <div class="page_nav">
        <?php echo $this->mypageclass->show(1); ?>
    </div>
</div>
<script type="text/javascript">
    $('#publish').click(function(){
        var $this = $(this);
        $this.html('发布中...');
        $.get('<?php echo site_url('weixin/admin/menu_send');?>', function (data) {
            if(data == 1){
                $.dialog.alert('发布到微信成功! ');
            }else{
                $.dialog.alert('发布到微信失败!请检查“配置信息”是否和微信后台的一致！检查菜单个数！');
            }
            $this.html('发布到微信');
        });
    });

    $('.weixinhead').each(function(){
        var $this = $(this);
        var openid = $this.attr('data-id');
        $.get('<?php echo site_url('weixin/admin/getweixin/?openid=');?>'+encodeURIComponent(openid), function(data){
            $this.html(data);
        });
    });

    $('')
</script>
</body>
</html>